<!DOCTYPE html>
<html lang="zh-cmn-Hans">
	<head>
		<meta charset="UTF-8">
		<meta http-equiv="X-UA-Compatible" content="ie=edge" />
		<title>鹿程智慧油站商户平台</title>
		<meta name="description" content="鹿程科技是提供加油站互联网化零管系统、营销及支付和大数据分析运营服务的行业领先科技公司。鹿程科技充分了解加油站行业的需求和新兴互联网的发展,依靠业内最先进的科技和标准化的运营,持续帮助油站业务发展创造价值。"/>
		<meta name="keywords" content="智慧油站,鹿程,鹿程智慧油站,鹿程智慧油站微信支付,加油站微信支付,加油站营销管理"/>
		<link rel="icon" href="https://static.zhihuiyouzhan.com.cn/static/styles/admin/img/title.ico" type="image/x-icon">
		<link rel="shortcut icon" href="https://static.zhihuiyouzhan.com.cn/static/styles/admin/img/title.ico" type="image/x-icon">
		<!--<link href="//netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">-->
		<link rel="stylesheet" href="../layui/css/layui.css" />
		<link rel="stylesheet" href="../css/style.css" />
	</head>
<body>
	<section class="section-right">
		<!--deer-tit-->
		<div class="deer-tit">
			<h3>系统配置</h3>
			<h4>油站设置</h4>
		</div>
		<!--/deer-tit-->
		<!--deer-content-->
		<div class="deer-content">
			<div class="ware-add">
				<form action="#" class="layui-form ware-add-form">
					<dl>
					    <dt>油站名称</dt>
					    <dd><input type="text" name="merchant_name" lay-verify="required" value="123" lay-verType="tips" placeholder="" autocomplete="on" class="layui-input"></dd>
				    </dl>
				    <dl>
					    <dt>地址</dt>
					    <dd class="sys-station">
					    	<div style="width:20%;">
							    <select  name="province">
                        		<option value="0">请选择省份</option>
                                <option value="9" selected="selected">山东省</option>
                                <option value="18">内蒙古</option>
                                <option value="19">吉林省</option>
                                <option value="20">黑龙江</option>
                                <option value="21">安徽省</option>
                                <option value="22">湖南省</option>
                                <option value="23">广西</option>
                                <option value="24">海南省</option>
                                <option value="25">云南省</option>
                                <option value="26">贵州省</option>
                                <option value="27">西藏</option>
                                <option value="28">甘肃省</option>
                                <option value="29">宁夏区</option>
                                <option value="30">青海省</option>
                                <option value="31">新疆</option>
                                <option value="32">香港</option>
                                <option value="33">澳门</option>
                                <option value="17">山西省</option>
                                <option value="16">河北省</option>
                                <option value="15">河南省</option>
                                <option value="14">湖北省</option>
                                <option value="13">陕西省</option>
                                <option value="12">四川省</option>
                                <option value="11">江西省</option>
                                <option value="10">辽宁省</option>
                                <option value="8">江苏省</option>
                                <option value="7">浙江省</option>
                                <option value="6">福建省</option>
                                <option value="5">广东省</option>
                                <option value="4">重庆</option>
                                <option value="3">天津</option>
                                <option value="2">上海</option>
                                <option value="1">北京</option>
                            	</select>
							</div>
							<div style="width:20%;">
								<select  name="city">
	                    		</select>
							</div>
							<div style="width:58%;">
								<p><input type="text" name="address" placeholder="" autocomplete="on" class="layui-input" value="753 Main Street"></p>
							</div>
						</dd>
				    </dl>
				    <dl>
				    	<dt>经纬度</dt>
				    	<dd class="sys-station col2">
				    		<div>
								<p><input type="text" name="lon" value="118.341293"  placeholder="经度" autocomplete="on" class="layui-input" ></p>
							</div>
							<div>
								<p><input type="text" name="lat" value="35.036743"  placeholder="纬度" autocomplete="on" class="layui-input" ></p>
							</div>
				    	</dd>
				    </dl>
				    <dl>
					    <dt>油站简介</dt>
					    <dd> 
					    	<textarea name="desc" placeholder="请输入内容" class="layui-textarea"></textarea>    						
					    </dd>
				    </dl>
					<button class="submit" lay-submit lay-filter="Submit" >提交</button>
				</form>
			</div>
		</div>
		<!--/deer-content-->		
	</section>
<!--js-->
	<aside>
		<script type="text/javascript" src="../layui/layui.js" ></script>
		<script type="text/javascript">
			
			layui.use(['form','jquery'],function(){
				var	form=layui.form;
				var $=layui.jquery;				
				
				//表单提交
				form.on('submit(Submit)', function(data){
					console.log(data.field) //当前容器的全部表单字段，名值对形式：{name: value}
					
					$.ajax({
			            url: '/',
			            data: data.field,
			            type: 'post',
			            datatype: 'json',
			            success: function (res) {
			                if (res.code == 1) {			                	
			                	layer.msg(res.msg);
			                    return;
			                }
				            }
				        });
					return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
				});
				
			//地址选择
			var province = "9";
	    	var city = "914";
		    if (province != 0) {
		        getArea(province, city, 'city');
		    } else {
		        $('[name="city"]').html("<option value='0'>请选择城市</option>");
		    }
		    $('[name="province"]').change(function () {
		        var area_id = $(this).val();
		        getArea(area_id, city, 'city')
		    });
		    function getArea(area_id, city, name) {
		        var h = "";
		        if (area_id == 0) {
		            $('[name="city"]').html("<option value='0'>请选择城市</option>");
		            return;
		        }
		        $.get("/index.php/merchant/config/areapid.html", {'area_id': area_id}, function (msg) {
		            $.each(msg, function (k, v) {
		                if (city == v.id) {
		                    h += "<option value='" + v.id + "' selected='selected'>" + v.name + "</option>";
		                } else {
		                    h += "<option value='" + v.id + "'>" + v.name + "</option>";
		                }
		            });
		            $('[name="' + name + '"]').html(h);
		        });
		    }
				
			})
			
		</script>
	</aside>
	<!--/js-->
</body>
</html>